import {createApp} from 'vue';
import Message from '@/components/Message.vue';
import vuertifyPlugin from '@/plugins/vuetify';

let msg:any;
function message(_type='success',_content:string,_duration=2000){
  msg?.unmount();
  msg=createApp(Message,{
    color:_type,
    content:_content,
    timeout:_duration,
    modelValue:true
  });
  msg.use(vuertifyPlugin).mount('#msg');
}

export {
  message
}